﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="StoreListAll.aspx.cs" Inherits="Admin_store_StoreList" %>

<%@ Register Assembly="AspNetPager" Namespace="Wuqi.Webdiyer" TagPrefix="webdiyer" %>
<!DOCTYPE html>
<html>
<head>

   <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>50CMS后台框架</title>
    <link rel="shortcut icon" href="favicon.ico">
    <link href="../css/font-awesome.css?v=4.4.0" rel="stylesheet">
    <link href="../css/animate.css" rel="stylesheet">
    <link href="../css/style.css?v=4.1.0" rel="stylesheet">
     <link href="../css/bootstrap.min.css?v=3.3.6" rel="stylesheet">
    <link href="../css/plugins/footable/footable.core.css" rel="stylesheet" />

</head>

<body class="gray-bg">
<form id="form1" runat="server" class="form-horizontal">
    <div class="wrapper wrapper-content animated fadeInRight">
        <div class="row">
            <div class="col-sm-12">
                <div class="ibox float-e-margins">
     
                    <div class="ibox-content">
   
                         <asp:Repeater ID="rptList" runat="server" OnItemCommand="rptList_ItemCommand" OnItemDataBound="rptList_ItemDataBound">
                            <HeaderTemplate>
                                <table class="footable  table table-stripped toggle-arrow-tiny " >
                                    <thead>
                                        <tr>
                                            <th align="center" width="25%">店</th>
                                            <th align="left">房间</th>
                                        </tr>
                                    </thead>
                                    <tbody>
                            </HeaderTemplate>
                            <ItemTemplate>
                                <tr class="gradeX">
                                      <asp:Label ID="od_id" runat="server" Text='<%#Eval("SID")%>' Visible="False"></asp:Label>
                            
                                        <td><%#Eval("Sname")%>
                                       <br> 
                                        
                                        <%#Eval("Stel")%> <br> 
                                        <%#Eval("Saddress")%><br> 
                                        <%#Eval("SGuid")%>
                                        <br>                                   
                                        <div onclick=door('<%#Eval("SGuid")%>',"open") class="btn btn-danger btn-xs"><i class="fa fa-pencil"></i>&nbsp;&nbsp;  开门</div>   
                                        <div onclick=door('<%#Eval("SGuid")%>',"close") class="btn btn-info btn-xs"><i class="fa fa-pencil"></i>&nbsp;&nbsp;  关门</div>  

                                    </td>

                                    <td>
                    <asp:Repeater ID="rptList22" runat="server" OnItemCommand="rptList_ItemCommand">
                            <HeaderTemplate>
                                <table class="footable table table-stripped toggle-arrow-tiny"  data-page-size="15" >
                                    <thead>
                                        <tr>
                                  
                                            <th align="center"  width="50%">名称</th>
      
                                            <th align="center">操作 </th>     
                                        </tr>
                                    </thead>
                                    <tbody>
                            </HeaderTemplate>
                            <ItemTemplate>
                                <tr>
                                    
                                <asp:Label ID="lb_id" runat="server" Text='<%#Eval("SItemID")%>'  Visible="False"></asp:Label>
                                    <td><%#Eval("Sname")%>-<%#Eval("sbid")%></td>
                       
                             

                                    <td >
                                        <div onclick=door('<%#Eval("sbid")%>',"open") class="btn btn-danger btn-xs"><i class="fa fa-pencil"></i>&nbsp;&nbsp;  开门</div>       
                                        <div onclick=door('<%#Eval("sbid")%>',"close") class="btn btn-info btn-xs"><i class="fa fa-pencil"></i>&nbsp;&nbsp;  关门</div>       
                                    
                                    </td>

                                </tr>
                            </ItemTemplate>
              <FooterTemplate>
                                    </tbody>                           
                                </table>
                                </FooterTemplate>
                        </asp:Repeater>

                                        </td>


                                </tr>


                               
                     

                         
                            </ItemTemplate>
                         <FooterTemplate>
                                    </tbody>                           
                                </table>
                                </FooterTemplate>
                        </asp:Repeater>
                   
                            <webdiyer:AspNetPager ID="AspNetPager1" runat="server" PageSize="20" FirstPageText="首页" LastPageText="末页" NextPageText="下一页" PrevPageText="上一页" AlwaysShow="true" OnPageChanging="AspNetPager1_PageChanging" CssClass="paginator" CurrentPageButtonClass="cpb">
                            </webdiyer:AspNetPager>
                   </div>
                </div>
            </div>
        </div>
    </div>
    </form>



      <!-- 全局js -->
    <script src="../js/jquery.min.js?v=2.1.4"></script>
    <script src="../js/bootstrap.min.js?v=3.3.6"></script>

      <!-- 自定js -->

    <script src="../js/plugins/footable/footable.all.min.js" type="text/javascript"></script>
    <script src="../js/content.js" type="text/javascript"></script>
    <script type="text/javascript" src="../js/layer/layer.js"></script>

    <script type="text/javascript">
        $(document).ready(function () { $(".footable").footable(); });
    </script>
    <script type="text/javascript">


        function door(SID, TYPE) {

            var data = new FormData();
            data.append('Action', TYPE);
            data.append('reserveId', SID);

            $.ajax({
                url: "Open.ashx",
                type: 'post',
                data: data,
                dataType: 'JSON',
                processData: false,
                contentType: false,
                success: function (json) {
                    
                    if (json.code == 1) {
                       console.log(json.msg);
                        layer.msg(json.msg, { icon: 1 });

                    }
                },
                error: function (XMLHttpRequest, textStatus, errorThrown) {
                    layer.msg("出错了，请稍后再试", { icon: 4 });
        
                }

            });
        };



        function setItem(ID) {
            layer.open({
                type: 2,
                title: '茶室',
                shadeClose: true,
                shade: 0.8,
                area: ['90%', '90%'],
                content: 'StoreItem.aspx?SID=' + ID,  //iframe的url
                end: function () {

                    location.reload();

                }
            });
        };

        

    </script>
 
</body>
</html>

